package com.atwisdom.star.core.dao.pojo.modelClass.hier;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 
 * @TableName hier_instance
 */
@TableName(value ="hier_instance",autoResultMap = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HierInstance implements Serializable {
    /**
     * 实例标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 实体类型
     */
    @TableField(value = "type")
    private String type;

    /**
     * 模型类名称
     */
    @TableField(value = "className")
    private String className;

    /**
     * 实例名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 容器id
     */
    @TableField(value = "containerId")
    private Long containerId;

    /**
     * 容器表
     */
    @TableField(value = "containerModel")
    private String containerModel;

    /**
     * 父节点Id
     */
    @TableField(value = "parentId")
    private String parentId;

    /**
     * 前驱节点
     */
    @TableField(value = "prev", typeHandler = FastjsonTypeHandler.class)
    protected JSONArray prev;

    /**
     * 节点Id
     */
    @TableField(value = "nodeId")
    private String nodeId;

    /**
     * 节点类型
     */
    @TableField(value = "nodeType")
    private String nodeType;

    /**
     * 属性信息
     */
    @TableField(value = "insValues",typeHandler = FastjsonTypeHandler.class)
    private JSONObject values;

    /**
     * 连接id
     */
    @TableField(value = "linkId", updateStrategy = FieldStrategy.IGNORED)
    private Long linkId;

    /**
     * 连接表名
     */
    @TableField(value = "linkModel")
    private String linkModel;

    /**
     * 连接class
     */
    @TableField(value = "linkClassName")
    private String linkClassName;

    /**
     * 连接类型
     */
    @TableField(value = "linkType")
    private String linkType;

    /**
     * 说明
     */
    @TableField(value = "comments")
    private String comments;
    /**
     * 逻辑删除
     */
    @TableField(value = "deleteFlag")
    public Boolean deleteFlag;
    /**
     * 创建人账号
     */
    @TableField(value = "createdBy",fill = FieldFill.INSERT)
    protected String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "createTime",fill = FieldFill.INSERT)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;

    /**
     * 修改人账号
     */
    @TableField(value = "updatedBy",fill = FieldFill.INSERT_UPDATE)
    protected String updatedBy;

    /**
     * 修改时间
     */
    @TableField(value = "updateTime",fill = FieldFill.INSERT_UPDATE)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime updateTime;

    /**
     * 
     */
    @TableField(value = "I0", updateStrategy = FieldStrategy.IGNORED)
    private Integer i0;

    /**
     * 
     */
    @TableField(value = "I1", updateStrategy = FieldStrategy.IGNORED)
    private Integer i1;

    /**
     * 
     */
    @TableField(value = "I2", updateStrategy = FieldStrategy.IGNORED)
    private Integer i2;

    /**
     * 
     */
    @TableField(value = "I3", updateStrategy = FieldStrategy.IGNORED)
    private Integer i3;

    /**
     * 
     */
    @TableField(value = "I4", updateStrategy = FieldStrategy.IGNORED)
    private Integer i4;

    /**
     * 
     */
    @TableField(value = "I5", updateStrategy = FieldStrategy.IGNORED)
    private Integer i5;

    /**
     * 
     */
    @TableField(value = "I6", updateStrategy = FieldStrategy.IGNORED)
    private Integer i6;

    /**
     * 
     */
    @TableField(value = "I7", updateStrategy = FieldStrategy.IGNORED)
    private Integer i7;

    /**
     * 
     */
    @TableField(value = "S0", updateStrategy = FieldStrategy.IGNORED)
    private String s0;

    /**
     * 
     */
    @TableField(value = "S1", updateStrategy = FieldStrategy.IGNORED)
    private String s1;

    /**
     * 
     */
    @TableField(value = "S2", updateStrategy = FieldStrategy.IGNORED)
    private String s2;

    /**
     * 
     */
    @TableField(value = "S3", updateStrategy = FieldStrategy.IGNORED)
    private String s3;

    /**
     * 
     */
    @TableField(value = "S4", updateStrategy = FieldStrategy.IGNORED)
    private String s4;

    /**
     * 
     */
    @TableField(value = "S5", updateStrategy = FieldStrategy.IGNORED)
    private String s5;

    /**
     * 
     */
    @TableField(value = "S6", updateStrategy = FieldStrategy.IGNORED)
    private String s6;

    /**
     * 
     */
    @TableField(value = "S7", updateStrategy = FieldStrategy.IGNORED)
    private String s7;

    /**
     * 
     */
    @TableField(value = "D0", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d0;

    /**
     * 
     */
    @TableField(value = "D1", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d1;

    /**
     * 
     */
    @TableField(value = "D2", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d2;

    /**
     * 
     */
    @TableField(value = "D3", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d3;

    /**
     * 
     */
    @TableField(value = "D4", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d4;

    /**
     * 
     */
    @TableField(value = "D5", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d5;

    /**
     * 
     */
    @TableField(value = "D6", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d6;

    /**
     * 
     */
    @TableField(value = "D7", updateStrategy = FieldStrategy.IGNORED)
    private BigDecimal d7;

    /**
     * 
     */
    @TableField(value = "B0", updateStrategy = FieldStrategy.IGNORED)
    private boolean b0;

    /**
     * 
     */
    @TableField(value = "B1", updateStrategy = FieldStrategy.IGNORED)
    private boolean b1;

    /**
     * 
     */
    @TableField(value = "B2", updateStrategy = FieldStrategy.IGNORED)
    private boolean b2;

    /**
     * 
     */
    @TableField(value = "B3", updateStrategy = FieldStrategy.IGNORED)
    private boolean b3;

    /**
     * 
     */
    @TableField(value = "B4", updateStrategy = FieldStrategy.IGNORED)
    private boolean b4;

    /**
     * 
     */
    @TableField(value = "B5", updateStrategy = FieldStrategy.IGNORED)
    private boolean b5;

    /**
     * 
     */
    @TableField(value = "B6", updateStrategy = FieldStrategy.IGNORED)
    private boolean b6;

    /**
     * 
     */
    @TableField(value = "B7", updateStrategy = FieldStrategy.IGNORED)
    private boolean b7;

    /**
     * 
     */
    @TableField(value = "T0", updateStrategy = FieldStrategy.IGNORED)
    private Date t0;

    /**
     * 
     */
    @TableField(value = "T1", updateStrategy = FieldStrategy.IGNORED)
    private Date t1;

    /**
     * 
     */
    @TableField(value = "T2", updateStrategy = FieldStrategy.IGNORED)
    private Date t2;

    /**
     * 
     */
    @TableField(value = "T3", updateStrategy = FieldStrategy.IGNORED)
    private Date t3;

    /**
     * 
     */
    @TableField(value = "T4", updateStrategy = FieldStrategy.IGNORED)
    private Date t4;

    /**
     * 
     */
    @TableField(value = "T5", updateStrategy = FieldStrategy.IGNORED)
    private Date t5;

    /**
     * 
     */
    @TableField(value = "T6", updateStrategy = FieldStrategy.IGNORED)
    private Date t6;

    /**
     * 
     */
    @TableField(value = "T7", updateStrategy = FieldStrategy.IGNORED)
    private Date t7;

    /**
     * 
     */
    @TableField(value = "ST0", updateStrategy = FieldStrategy.IGNORED)
    private String st0;

    /**
     * 
     */
    @TableField(value = "ST1", updateStrategy = FieldStrategy.IGNORED)
    private String st1;

    /**
     * 
     */
    @TableField(value = "ST2", updateStrategy = FieldStrategy.IGNORED)
    private String st2;

    /**
     * 
     */
    @TableField(value = "ST3", updateStrategy = FieldStrategy.IGNORED)
    private String st3;

    /**
     * 
     */
    @TableField(value = "ST4", updateStrategy = FieldStrategy.IGNORED)
    private String st4;

    /**
     * 
     */
    @TableField(value = "ST5", updateStrategy = FieldStrategy.IGNORED)
    private String st5;

    /**
     * 
     */
    @TableField(value = "ST6", updateStrategy = FieldStrategy.IGNORED)
    private String st6;

    /**
     * 
     */
    @TableField(value = "ST7", updateStrategy = FieldStrategy.IGNORED)
    private String st7;

    /**
     * 
     */
    @TableField(value = "ST8", updateStrategy = FieldStrategy.IGNORED)
    private String st8;

    /**
     * 
     */
    @TableField(value = "ST9", updateStrategy = FieldStrategy.IGNORED)
    private String st9;

    /**
     * 
     */
    @TableField(value = "ST10", updateStrategy = FieldStrategy.IGNORED)
    private String st10;

    /**
     * 
     */
    @TableField(value = "ST11", updateStrategy = FieldStrategy.IGNORED)
    private String st11;

    /**
     * 
     */
    @TableField(value = "ST12", updateStrategy = FieldStrategy.IGNORED)
    private String st12;

    /**
     * 
     */
    @TableField(value = "ST13", updateStrategy = FieldStrategy.IGNORED)
    private String st13;

    /**
     * 
     */
    @TableField(value = "ST14", updateStrategy = FieldStrategy.IGNORED)
    private String st14;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    public HierInstance(Long id, JSONObject values) {
        this.id = id;
        this.values = values;
    }

}